package com.example.demo.designPatternsTest;

/**
 * @author lilinchun
 * @date 2023/5/22 0022 20:07
 */
public class PowerAdapter implements TypeCInterface {
    private TypeA typeA;

    private TypeB typeB;

    public PowerAdapter(TypeA typeA) {
        this.typeA = typeA;
    }

    public PowerAdapter(TypeB typeB) {
        this.typeB = typeB;
    }

    @Override
    public void v5() {
        if (typeA != null) {
            typeA.v220();
        }
        if (typeB != null) {
            typeB.v110();
        }
    }
}
